package Controllers;

import java.rmi.RemoteException;

import TechStuff.BishopControllerStarter;
import TechStuff.BoardControllerStarter;
import TechStuff.KingControllerStarter;
import TechStuff.KnightControllerStarter;
import TechStuff.PawnControllerStarter;
import TechStuff.QueenControllerStarter;
import TechStuff.RookControllerStarter;

import Controllers.ControllerCreaterInterfece;

public class ControllerCreater implements ControllerCreaterInterfece {

	private int index;
	private PawnControllerStarter pawnControllerStarter;
	private BoardControllerStarter boardControllerStarter;
	private KnightControllerStarter knightControllerStarter;
	private RookControllerStarter rookControllerStarter;
	private QueenControllerStarter queenControllerStarter;
	private KingControllerStarter kingControllerStarter;
	private BishopControllerStarter bishopControllerStarter;

	public ControllerCreater(PawnControllerStarter pawnControllerStarter,
			BoardControllerStarter boardControllerStarter,
			KnightControllerStarter knightControllerStarter,
			RookControllerStarter rookControllerStarter,
			QueenControllerStarter queenControllerStarter,
			KingControllerStarter kingControllerStarter,
			BishopControllerStarter bishopControllerStarter) {
		this.pawnControllerStarter = pawnControllerStarter;
		this.boardControllerStarter = boardControllerStarter;
		this.knightControllerStarter = knightControllerStarter;
		this.rookControllerStarter = rookControllerStarter;
		this.queenControllerStarter = queenControllerStarter;
		this.kingControllerStarter = kingControllerStarter;
		this.bishopControllerStarter = bishopControllerStarter;
		index = 0;
	}

	@Override
	public String createBoard() throws RemoteException {
		// TODO Auto-generated method stub
		return boardControllerStarter.createBoard(index++);
	}

	@Override
	public String createPawn() throws RemoteException {
		// TODO Auto-generated method stub
		return pawnControllerStarter.createChessPiece(index++);
	}

	@Override
	public String createKnight() throws RemoteException {
		// TODO Auto-generated method stub
		return knightControllerStarter.createChessPiece(index++);
	}

	@Override
	public String createRook() throws RemoteException {
		// TODO Auto-generated method stub
		return rookControllerStarter.createChessPiece(index++);
	}

	@Override
	public String createQueen() throws RemoteException {
		// TODO Auto-generated method stub
		return queenControllerStarter.createChessPiece(index++);
	}

	@Override
	public String createKing() throws RemoteException {
		// TODO Auto-generated method stub
		return kingControllerStarter.createChessPiece(index++);
	}

	@Override
	public String createBishop() throws RemoteException {
		// TODO Auto-generated method stub
		return bishopControllerStarter.createChessPiece(index++);
	}

}
